# stdin: <m_url, m_anchor, weight, urlnew, m_in_date, del_flag>
import sys
import random


sampleRatio = float(sys.argv[1])
randomSeed = 1
randomGenerator = random.Random()
randomGenerator.seed(randomSeed)

for line in sys.stdin:
    line = line.rstrip("\n").strip(" ")
    v = randomGenerator.random()
    if (v < sampleRatio):
        print line


